﻿using ProjectManager.Logic.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectManager.Logic
{
    internal static class FindParent
    {
        public static ProjectTaskInformation? GetParent(this ProjectTaskInformation projectTaskInformation, IEnumerable<ProjectTaskInformation> projectTasks)
        {
            foreach (var projectTask in projectTasks)
            {
                foreach(var childTask in projectTask.ChildTask)
                {
                    if (childTask.ID == projectTaskInformation.ID)
                        return projectTask;
                }
            }
            return null;
        }
    }
}
